<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\adminapi\validate\user;

use app\adminapi\validate\Base;

class PointsValidate extends Base
{
    protected $rule = [
        'id'      => 'require',
        'user_id' => 'require|number',
        'points'  => 'require|number',
        'type'    => 'require|max:30',
        'remark'  => 'max:255',
    ];

    protected $message = [
        'id.require'      => 'id_required',
        'user_id.require' => 'user_id_required',
        'user_id.number'  => 'user_id_number',
        'points.require'  => 'points_required',
        'points.number'   => 'points_number',
        'type.require'    => 'type_required',
        'type.max'        => 'type_max',
        'remark.max'      => 'remark_max',
    ];

    // adjust
    public function sceneAdjust()
    {
        return $this->only(['user_id', 'points', 'remark']);
    }

    // list
    public function sceneList()
    {
        return $this->only(['user_id', 'type']);
    }
}